package com.keepers.repair.adapter

import android.view.View
import android.widget.Button
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.keepers.repair.R
import com.keepers.repair.model.TaskMaintenanceModel

/**
 * auth aboom
 * date 2018/11/17
 */
class TaskMaintenanceAdapter(layoutResId: Int) : BaseQuickAdapter<TaskMaintenanceModel, BaseViewHolder>(layoutResId) {

    override fun convert(helper: BaseViewHolder, item: TaskMaintenanceModel) {
        helper.setText(R.id.item_task_name, item.TaskName)
        helper.setText(R.id.item_task_time, item.DataTime)
        helper.setText(R.id.item_task_user, item.Name + "-" + item.UserName)
        helper.setText(R.id.item_task_place, item.PlaceName)
        helper.setText(R.id.item_task_line, item.LineName)
        val detail = helper.getView<Button>(R.id.item_task_detail)
        detail.visibility = if (item.isShowDetail) View.VISIBLE else View.GONE
        detail.setOnClickListener {

        }
        helper.addOnClickListener(R.id.item_task_button)
    }
}
